<?php
/*
 * Copyright (c) 2017-2025 Tencent. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
namespace TencentCloud\Kms\V20190118\Models;
use TencentCloud\Common\AbstractModel;

/**
 * ImportDataKey request structure.
 *
 * @method string getDataKeyName() Obtain Name of the data key.
 * @method void setDataKeyName(string $DataKeyName) Set Name of the data key.
 * @method string getImportKeyMaterial() Obtain If the imported key is plaintext data key, it is the base64 plaintext data key after conversion. if the imported key is ciphertext data key, it is the ciphertext data key generated by the KMS GenerateDataKey interface.
 * @method void setImportKeyMaterial(string $ImportKeyMaterial) Set If the imported key is plaintext data key, it is the base64 plaintext data key after conversion. if the imported key is ciphertext data key, it is the ciphertext data key generated by the KMS GenerateDataKey interface.
 * @method integer getImportType() Obtain 1: ciphertext import (data key generated by KMS api) 2: plaintext import.
 * @method void setImportType(integer $ImportType) Set 1: ciphertext import (data key generated by KMS api) 2: plaintext import.
 * @method string getDescription() Obtain Describes the data key. maximum 100 bytes.
 * @method void setDescription(string $Description) Set Describes the data key. maximum 100 bytes.
 * @method string getKeyId() Obtain When importing an encrypted data key, no need to input the root key. if the input is provided, validate whether the KeyId matches the one in the ciphertext.
When importing plaintext data key, KeyId cannot be empty. the data key is encrypted with the specified root key.
 * @method void setKeyId(string $KeyId) Set When importing an encrypted data key, no need to input the root key. if the input is provided, validate whether the KeyId matches the one in the ciphertext.
When importing plaintext data key, KeyId cannot be empty. the data key is encrypted with the specified root key.
 * @method string getHsmClusterId() Obtain HSM cluster ID corresponding to the KMS exclusive edition. if HsmClusterId is specified, it indicates the root key is in this cluster and verifies whether KeyId corresponds to HsmClusterId.
 * @method void setHsmClusterId(string $HsmClusterId) Set HSM cluster ID corresponding to the KMS exclusive edition. if HsmClusterId is specified, it indicates the root key is in this cluster and verifies whether KeyId corresponds to HsmClusterId.
 */
class ImportDataKeyRequest extends AbstractModel
{
    /**
     * @var string Name of the data key.
     */
    public $DataKeyName;

    /**
     * @var string If the imported key is plaintext data key, it is the base64 plaintext data key after conversion. if the imported key is ciphertext data key, it is the ciphertext data key generated by the KMS GenerateDataKey interface.
     */
    public $ImportKeyMaterial;

    /**
     * @var integer 1: ciphertext import (data key generated by KMS api) 2: plaintext import.
     */
    public $ImportType;

    /**
     * @var string Describes the data key. maximum 100 bytes.
     */
    public $Description;

    /**
     * @var string When importing an encrypted data key, no need to input the root key. if the input is provided, validate whether the KeyId matches the one in the ciphertext.
When importing plaintext data key, KeyId cannot be empty. the data key is encrypted with the specified root key.
     */
    public $KeyId;

    /**
     * @var string HSM cluster ID corresponding to the KMS exclusive edition. if HsmClusterId is specified, it indicates the root key is in this cluster and verifies whether KeyId corresponds to HsmClusterId.
     */
    public $HsmClusterId;

    /**
     * @param string $DataKeyName Name of the data key.
     * @param string $ImportKeyMaterial If the imported key is plaintext data key, it is the base64 plaintext data key after conversion. if the imported key is ciphertext data key, it is the ciphertext data key generated by the KMS GenerateDataKey interface.
     * @param integer $ImportType 1: ciphertext import (data key generated by KMS api) 2: plaintext import.
     * @param string $Description Describes the data key. maximum 100 bytes.
     * @param string $KeyId When importing an encrypted data key, no need to input the root key. if the input is provided, validate whether the KeyId matches the one in the ciphertext.
When importing plaintext data key, KeyId cannot be empty. the data key is encrypted with the specified root key.
     * @param string $HsmClusterId HSM cluster ID corresponding to the KMS exclusive edition. if HsmClusterId is specified, it indicates the root key is in this cluster and verifies whether KeyId corresponds to HsmClusterId.
     */
    function __construct()
    {

    }

    /**
     * For internal only. DO NOT USE IT.
     */
    public function deserialize($param)
    {
        if ($param === null) {
            return;
        }
        if (array_key_exists("DataKeyName",$param) and $param["DataKeyName"] !== null) {
            $this->DataKeyName = $param["DataKeyName"];
        }

        if (array_key_exists("ImportKeyMaterial",$param) and $param["ImportKeyMaterial"] !== null) {
            $this->ImportKeyMaterial = $param["ImportKeyMaterial"];
        }

        if (array_key_exists("ImportType",$param) and $param["ImportType"] !== null) {
            $this->ImportType = $param["ImportType"];
        }

        if (array_key_exists("Description",$param) and $param["Description"] !== null) {
            $this->Description = $param["Description"];
        }

        if (array_key_exists("KeyId",$param) and $param["KeyId"] !== null) {
            $this->KeyId = $param["KeyId"];
        }

        if (array_key_exists("HsmClusterId",$param) and $param["HsmClusterId"] !== null) {
            $this->HsmClusterId = $param["HsmClusterId"];
        }
    }
}
